package com.mxx.common.data.mybatisplus;

import com.baomidou.mybatisplus.core.conditions.AbstractLambdaWrapper;
import com.baomidou.mybatisplus.core.enums.SqlKeyword;
import com.baomidou.mybatisplus.core.enums.SqlLike;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.mxx.common.utils.Strings;

import java.util.Collection;

/**
 * @author: mxx
 * @date: 2021/11/4
 * @time: 14:57
 * @Description: 描述信息
 */
public abstract class IgnoreNullAbstractLambdaWrapper<T, Children extends IgnoreNullAbstractLambdaWrapper<T, Children>> extends AbstractLambdaWrapper <T,Children>{


    @Override
    public Children eq(SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.eq(column, val);
        }
        return typedThis;
    }

    @Override
    public Children eq(boolean condition, SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.eq(condition, column, val);
        }
        return typedThis;
    }

    @Override
    public Children like(SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.like(column, val);
        }
        return typedThis;
    }

    @Override
    public Children like(boolean condition, SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.like(condition, column, val);
        }
        return typedThis;
    }

    @Override
    public Children likeLeft(SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.likeLeft(column, val);
        }
        return typedThis;
    }

    @Override
    public Children likeRight(SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.likeRight(column, val);
        }
        return typedThis;
    }

    @Override
    protected Children likeValue(boolean condition, SqlKeyword keyword, SFunction<T, ?> column, Object val, SqlLike sqlLike) {
        if (Strings.isNotEmpty(val)) {
            return super.likeValue(condition, keyword, column, val, sqlLike);
        }
        return typedThis;
    }

    @Override
    public Children likeLeft(boolean condition, SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.likeLeft(condition, column, val);
        }
        return typedThis;
    }

    @Override
    public Children likeRight(boolean condition, SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.likeRight(condition, column, val);
        }
        return typedThis;
    }

    @Override
    public Children notLike(SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.notLike(column, val);
        }
        return typedThis;
    }

    @Override
    public Children notLike(boolean condition, SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.notLike(condition, column, val);
        }
        return typedThis;
    }

    @Override
    public Children in(SFunction<T, ?> column, Object... values) {
        if (Strings.isNotEmpty(values)) {
            return super.in(column, values);
        }
        return typedThis;
    }

    @Override
    public Children in(boolean condition, SFunction<T, ?> column, Object... values) {
        if (Strings.isNotEmpty(values)) {
            return super.in(condition, column, values);
        }
        return typedThis;
    }

    @Override
    public Children in(SFunction<T, ?> column, Collection<?> coll) {
        if (Strings.isNotEmpty(coll)) {
            return super.in(column, coll);
        }
        return typedThis;
    }

    @Override
    public Children in(boolean condition, SFunction<T, ?> column, Collection<?> coll) {
        if (Strings.isNotEmpty(coll)) {
            return super.in(condition, column, coll);
        }
        return typedThis;
    }

    @Override
    public Children notIn(SFunction<T, ?> column, Object... values) {
        if (Strings.isNotEmpty(values)) {
            return super.notIn(column, values);
        }
        return typedThis;
    }

    @Override
    public Children notIn(SFunction<T, ?> column, Collection<?> coll) {
        if (Strings.isNotEmpty(coll)) {
            return super.notIn(column, coll);
        }
        return typedThis;
    }

    @Override
    public Children notIn(boolean condition, SFunction<T, ?> column, Object... values) {
        if (Strings.isNotEmpty(values)) {
            return super.notIn(condition, column, values);
        }
        return typedThis;
    }

    @Override
    public Children notIn(boolean condition, SFunction<T, ?> column, Collection<?> coll) {
        if (Strings.isNotEmpty(coll)) {
            return super.notIn(condition, column, coll);
        }
        return typedThis;
    }

    @Override
    public Children gt(SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.gt(column, val);
        }
        return typedThis;
    }

    @Override
    public Children gt(boolean condition, SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.gt(condition, column, val);
        }
        return typedThis;
    }

    @Override
    public Children ge(SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.ge(column, val);
        }
        return typedThis;
    }

    @Override
    public Children ge(boolean condition, SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.ge(condition, column, val);
        }
        return typedThis;
    }

    @Override
    public Children ne(SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.ne(column, val);
        }
        return typedThis;
    }

    @Override
    public Children ne(boolean condition, SFunction<T, ?> column, Object val) {
        if (Strings.isNotEmpty(val)) {
            return super.ne(condition, column, val);
        }
        return typedThis;
    }

    @Override
    public Children between(SFunction<T, ?> column, Object val1, Object val2) {
        if (Strings.isNotEmpty(val1, val2)) {
            return super.between(column, val1, val2);
        }
        return typedThis;
    }

    @Override
    public Children between(boolean condition, SFunction<T, ?> column, Object val1, Object val2) {
        if (Strings.isNotEmpty(val1, val2)) {
            return super.between(condition, column, val1, val2);
        }
        return typedThis;
    }

    @Override
    public Children notBetween(SFunction<T, ?> column, Object val1, Object val2) {
        if (Strings.isNotEmpty(val1, val2)) {
            return super.notBetween(column, val1, val2);
        }
        return typedThis;
    }

    @Override
    public Children notBetween(boolean condition, SFunction<T, ?> column, Object val1, Object val2) {
        if (Strings.isNotEmpty(val1, val2)) {
            return super.notBetween(condition, column, val1, val2);
        }
        return typedThis;
    }

}
